package lzw;

/**
 *
 * @author Atuan
 */
public class Euclid {
    private static long greatestCommonDivisor(long a, long b) {
        long tmp;
        while (b != 0) {
            tmp = b;
            b = a % b;
            a = tmp;
        }
        return Math.abs(a);
    }

    public static long leastCommonMultiple(long a, long b) {
        return Math.abs((a * b) / greatestCommonDivisor(a, b));
    }
}